-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add siwe auth endpoints #177
Conversation
src/index.ts
Outdated
{ | ||
body, | ||
}, | ||
true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to make the credentials flag part of the endpoint type in api.ts.
src/index.ts
Outdated
@@ -640,4 +641,15 @@ export function getContract(chainId: string, contractAddress: string): Promise<C | |||
}) | |||
} | |||
|
|||
export function getAuthNonce(): Promise<AuthNonce> { | |||
return getEndpoint(baseUrl, '/v1/auth/nonce', { credentials: 'include' }, undefined) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to pass undefined
explicitly?
return getEndpoint(baseUrl, '/v1/auth/nonce', { credentials: 'include' }, undefined) | |
return getEndpoint(baseUrl, '/v1/auth/nonce', { credentials: 'include' }) |
src/types/api.ts
Outdated
post: operations['verify_auth'] | ||
parameters: { | ||
path: null | ||
credentials: RequestCredentials |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can only be include
, right? The endpoint doesn't make sense w/ a different value.
credentials: RequestCredentials | |
credentials: 'include' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gut diese
What it solves
getAuthNonce
andverifyAuth
includeCredentials
parameter to get/post/put/delete callsHow to test
yarn link